-- GENERATED SPELL FOR [Scarlet Trooper] --


function spell0_12352(pUnit, Event) --@Devotion Aura,Self--
pUnit:FullCastSpellOnTarget(8258,pUnit)
pUnit:RegisterEvent('Sorts_12352', 634, 1)
end

function spell1_12352(pUnit, Event) --@Divine Shield,Self--
pUnit:FullCastSpellOnTarget(13874,pUnit)
pUnit:RegisterEvent('Sorts_12352', 8312, 1)
end

function spell2_12352(pUnit, Event) --@Exorcism,n/a--
pUnit:FullCastSpellOnTarget(17149,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12352', 592, 1)
end

function spell3_12352(pUnit, Event) --@Hammer of Justice,n/a--
pUnit:FullCastSpellOnTarget(13005,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12352', 6286, 1)
end

function spell4_12352(pUnit, Event) --@Holy Light,Heal--
pUnit:FullCastSpellOnTarget(15493,pUnit)
pUnit:RegisterEvent('Sorts_12352', 2500, 1)
end

function spell5_12352(pUnit, Event) --@Resurrect Trooper,n/a--
pUnit:FullCastSpellOnTarget(19721,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12352', 622, 1)
end

function spell6_12352(pUnit, Event) --@Summon Scarlet Trooper,n/a--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(19722,pUnit:GetMainTank ())
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_12352', 1, 1)
end

function spell7_12352(pUnit, Event) --@Trooper Ping,n/a--
pUnit:FullCastSpellOnTarget(19749,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12352', 616, 1)
end

function Sorts_12352(pUnit, Event)
local choix_sorts_12352 = math.random(0, 7)
if choix_sorts_12352 == 0 then
pUnit:RegisterEvent('spell0_12352', 1, 1)
end
if choix_sorts_12352 == 1 then
pUnit:RegisterEvent('spell1_12352', 1, 1)
end
if choix_sorts_12352 == 2 then
pUnit:RegisterEvent('spell2_12352', 1, 1)
end
if choix_sorts_12352 == 3 then
pUnit:RegisterEvent('spell3_12352', 1, 1)
end
if choix_sorts_12352 == 4 then
pUnit:RegisterEvent('spell4_12352', 1, 1)
end
if choix_sorts_12352 == 5 then
pUnit:RegisterEvent('spell5_12352', 1, 1)
end
if choix_sorts_12352 == 6 then
pUnit:RegisterEvent('spell6_12352', 1, 1)
end
if choix_sorts_12352 == 7 then
pUnit:RegisterEvent('spell7_12352', 1, 1)
end
end

function mob12352_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_12352', math.random(1500, 3000), 1)
end

function mob12352_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob12352_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob12352_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(12352, 1, 'mob12352_Action')
RegisterUnitEvent(12352, 2, 'mob12352_Leave')
RegisterUnitEvent(12352, 3, 'mob12352_Kill')
RegisterUnitEvent(12352, 4, 'mob12352_Die')
